<script>
$(document).ready(function(){

	function getStudent() {
		var year_semester = $("#year_semester").val();
		var classSn = $("#classSn").val();
		$.get('<?php echo $this->route("get-student")?>',
				{year_semester: year_semester, classSn:classSn},
				function(data){
				   $("#student-list").html(data);
				   getTargetClass();
				});
	}

	function getTargetClass()
	{
		   var classSn = $("#classSn option:selected").parent().clone();
		  $(classSn).children('option[value='+$("#classSn").val()+']').remove();//attr('disabled',true);
		   $("#moveTarget").html($(classSn).html());
	}

	$("#year_semester").change(function(){ $("#selForm").submit()});
	$("#classSn").change(getStudent);

	$("#act").click(function(){
	    $("#selForm").submit();
    });

	getStudent();

});
</script>
<style>
#leftArea ,#rightArea{float:left; margin:5px; border:thin #ccc solid;padding:5px;}
#leftArea table {margin:5px auto; border:#533 solid thin; background:#ffe;width:95%}
</style>
<form method="post" action="" id="selForm">
<div id="leftArea">
<select name="year_semester" id="year_semester">
<?php echo $this->YearSemesterOptions($this->yearSemester,array('order'=>'year DESC'))?>
</select>
<select name="classSn" id="classSn">
<?php echo $this->classNameOptions($this->yearSemester,$this->classSn)?>
</select>
<?php echo $this->translate('student place')?>

<div id="student-list">
</div>
</div>

<div id="rightArea">
<span><?php echo $this->translate('move to target class from checked student')?></span>
<br />
<select id="moveTarget" name="moveTarget"></select>
<input type="button" name="act"  id="act" value="<?php echo $this->translate('move')?>" />
</div>
<div style="clear:both"></div>
</form>